<template>
  <appointment-panel
    v-model="appointmentPanel.visible"
    :data="appointmentPanel.data"
    :patient="appointmentPanel.patient"
    :type="appointmentPanel.type"
    @submit="handleSubmit"
  ></appointment-panel>
</template>

<script>
import { mapState } from 'vuex'
import { SAVE_APPOINTMENT_PANEL } from '@/store/modules/userMatcher'

export default {
  name: 'UserMatcherAppointment',
  components: {
    AppointmentPanel: () => import('@/components/yiya/AppointmentPanel'),
  },
  computed: {
    ...mapState({
      appointmentPanel: (state) => state.userMatcher.appointmentPanel,
    }),
  },
  mounted() {
    this.$store.commit({
      type: `userMatcher/${SAVE_APPOINTMENT_PANEL}`,
      value: {
        visible: false,
      },
    })
  },
  methods: {
    handleSubmit() {
      this.$emit('submit')
    },
  },
}
</script>

<style scoped></style>
